using UniversalAdmin.Domain.Entities;
using UniversalAdmin.Shared.Enums;

namespace UniversalAdmin.Domain.Repositories;

public interface IArticleRepository : IRepository<Article>
{
    Task<(IEnumerable<Article> Articles, int TotalCount)> GetPagedAsync(int page, int pageSize, ArticleStatus? status = null, Guid? categoryId = null, string? keyword = null);
    Task<IEnumerable<Article>> GetByCategoryAsync(Guid categoryId, int page, int pageSize);
    Task<IEnumerable<Article>> GetByAuthorAsync(Guid authorId, int page, int pageSize);
}

public interface IArticleCategoryRepository : IRepository<ArticleCategory>
{
    Task<bool> HasChildrenAsync(Guid id);
    Task<bool> HasArticlesAsync(Guid id);
    Task<IEnumerable<ArticleCategory>> GetByIdsAsync(IEnumerable<Guid> ids);
}